// 轻量资源预热：在空闲时间预取常用路由对应的 chunk，减少首次进入时的冷启动等待

let warmed = false;

export function warmupChunks() {
    if (warmed) return;
    warmed = true;
    try {
        const tasks: Array<Promise<any>> = [];
        const importView = (p: string) => tasks.push(import(/* @vite-ignore */ p));
        // 常用页面：根据你的系统菜单可按需增删
        importView('/@/views/dashboard/home.vue');
        importView('/@/views/OutWarehou/sysstocktakingorder/index.vue');
        importView('/@/views/OutWarehou/sysinstockorder/index.vue');
        importView('/@/views/OutWarehou/systransferorder/index.vue');
        Promise.allSettled(tasks);
    } catch {
        // 忽略预热失败
    }
}


